package com.fubowen.reader.db.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.fubowen.reader.db.bean.WebSiteBean
import com.fubowen.reader.db.bean.WebSiteConfigBean

@Dao
interface WebSiteDao {
    @Query("select * from WebSiteBean order by timestamp desc")
    fun all(): List<WebSiteBean>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun setOrIgnore(bean: WebSiteBean): Long

    @Query("select * from WebSiteConfigBean where `key` in (:keys)")
    fun getSpiderByKeyList(keys: List<String>): List<WebSiteConfigBean>

}